import { message } from 'antd';
import api from '../../../services';
const {updateUserProfile} = api

export default {
    namespace: "personalData",
    state:{},

    subscriptions: {
    },

    effects: {
        *updateUserProfileEffect({ payload }, { call, put}) {
            const result = yield call(updateUserProfile, payload);
            if (result.code === 0) {
                message.success("导入成功")
                yield put({ type: "user/updateUser", payload: { userInfo: result.data } });
            }
            else {
                message.error(result.message, 3)
            }
        },
    },

    reducers: {
        *updateState(state, action) {
            return { ...state, ...action.payload };
        }
    }
}